﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucPartsUsed.ascx.cs" Inherits="UserControl_ucPartsUsed" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<style type="text/css">
    .test_bt td
    {
        padding: 0;
    }
    .test_bt table
    {
        top: 0 !important;
    }
    .test_bt input
    {
        width: 100% !important;
    }
    .test_bt button
    {
        height: 23px !important;
        margin: 0 !important;
        padding: 0 !important;
        visibility: visible !important;
        width: 23px !important;
    }
    .test_bt ul
    {
        width: 106px !important;
        height: auto !important;
    }
    .lable
    {
        color: #c0c0c0;
    }
    .tblgrid th, .tblgrid td
    {
        width: auto;
    }
</style>
<table id="tab">
    <tr>
        <td>
            Search
        </td>
        <td class="test_bt">
            <asp:UpdatePanel ID="up" runat="server">
                <ContentTemplate>
                    <asp:TextBox ID="txtSearchPart" runat="server" OnTextChanged="txtSearchPart_TextChanged"
                        AutoPostBack="true"></asp:TextBox>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="txtSearchPart" EventName="TextChanged" />
                </Triggers>
            </asp:UpdatePanel>
        </td>
        <td>
        </td>
        <td>
        </td>
    </tr>
    <tr>
        <td>
            Part Description
        </td>
        <td class="test_bt">
            <%--<asp:TextBox ID="txtpartDescription" runat="server"></asp:TextBox>--%>
            <asp:UpdatePanel ID="upPanel" runat="server">
                <ContentTemplate>
                    <asp:ComboBox ID="cbParDescription" runat="server" Width="100px" AutoCompleteMode="Append"
                        AutoPostBack="True" MaxLength="0" OnSelectedIndexChanged="cbParDescription_SelectedIndexChanged">
                    </asp:ComboBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"
                        ControlToValidate="cbParDescription" ValidationGroup="save"></asp:RequiredFieldValidator>
                </ContentTemplate>
            </asp:UpdatePanel>
        </td>
        <td>
            Quantity
        </td>
        <td>
            <asp:TextBox ID="txtquantity" runat="server" Width="50%"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*"
                ControlToValidate="txtquantity" ValidationGroup="save"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td>
            <asp:Label ID="lb_ProductCode" runat="server" Text="Product code" CssClass="lable"></asp:Label>
        </td>
        <td>
            <asp:Label runat="server" ID="lbProductCode" CssClass="lable"></asp:Label>
        </td>
        <td>
            <asp:Label ID="lb_Model" runat="server" Text="Model" CssClass="lable"></asp:Label>
        </td>
        <td>
            <asp:Label runat="server" ID="lbModel" CssClass="lable"></asp:Label>
        </td>
    </tr>
    <tr>
        <td>
            <asp:Label ID="lb_Brand" runat="server" Text="Brand" CssClass="lable"></asp:Label>
        </td>
        <td>
            <asp:Label runat="server" ID="lbBrand" CssClass="lable"></asp:Label>
        </td>
        <td>
            <asp:Label ID="lb_Cost" runat="server" Text="Cost" CssClass="lable"></asp:Label>
        </td>
        <td>
            <asp:Label runat="server" ID="lbCost" CssClass="lable"></asp:Label>
        </td>
    </tr>
    <tr>
        <td>
            <asp:Label ID="lb_RRP" runat="server" Text="RRP" CssClass="lable"></asp:Label>
        </td>
        <td>
            <asp:Label runat="server" ID="lbRRP" CssClass="lable"></asp:Label>
        </td>
        <td>
        </td>
        <td>
        </td>
    </tr>
    <tr>
        <td colspan="4" align="center">
            <asp:Button ID="btnSave" runat="server" Text="Update" OnClick="btnSave_Click" Height="30px"
                ValidationGroup="save" />
        </td>
    </tr>
</table>
<table class="tblgrid">
    <tr>
        <td>
            <asp:Panel ID="panel" runat="server" Height="400px" ScrollBars="Auto">
                <asp:GridView ID="grdPartsUsed" runat="server" AutoGenerateColumns="False" CssClass="grd"
                    Width="100%">
                    <Columns>
                        <asp:TemplateField HeaderText="Job ID">
                            <ItemTemplate>
                                <%# Eval("JobID")%>
                            </ItemTemplate>
                            <ItemStyle Width="60px" VerticalAlign="Middle" HorizontalAlign="Center"></ItemStyle>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Phone Brand">
                            <ItemTemplate>
                                <%# Eval("PhoneBrand")%>
                            </ItemTemplate>
                            <ItemStyle Width="150px" VerticalAlign="Middle" HorizontalAlign="Center"></ItemStyle>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Phone Model">
                            <ItemTemplate>
                                <%# Eval("PhoneModel")%>
                            </ItemTemplate>
                            <ItemStyle Width="150px" VerticalAlign="Middle" HorizontalAlign="Center"></ItemStyle>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Part Description">
                            <ItemTemplate>
                                <%# Eval("PartDescription")%>
                            </ItemTemplate>
                            <ItemStyle Width="300px" VerticalAlign="Middle" HorizontalAlign="Center"></ItemStyle>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Quantity">
                            <ItemTemplate>
                                <%# Eval("Quantity")%>
                            </ItemTemplate>
                            <ItemStyle Width="90px" VerticalAlign="Middle" HorizontalAlign="Center"></ItemStyle>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Date">
                            <ItemTemplate>
                                <%# (Convert.ToDateTime(Eval("DateEntered")).ToString("dd/MM/yyyy"))%>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Left" Wrap="True" Width="110px"></ItemStyle>
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle CssClass="grdHeader" />
                    <EditRowStyle BackColor="#2461BF" />
                    <AlternatingRowStyle CssClass="grdAlternateRow" />
                    <PagerSettings PageButtonCount="6" />
                    <RowStyle CssClass="grdRow" />
                </asp:GridView>
            </asp:Panel>
        </td>
    </tr>
</table>
